package model;

/**
 *
 * @author Dustin
 */
public class Edge {
    private int weight;
    private Vertex toVertex;
    private Vertex fromVertex;

    public Edge(int aWeight, Vertex vertexFrom, Vertex vertexTo) {
        weight = aWeight;
        fromVertex = vertexFrom;
        toVertex = vertexTo;
        
        toVertex.addEdge(this);
        fromVertex.addEdge(this);
    }

    public int getWeight() {
        return weight;
    }

    public Vertex getToVertex() {
        return toVertex;
    }

    public Vertex getFromVertex() {
        return fromVertex;
    }

    public void setWeight(int aWeight) {
        weight = aWeight;
    }

    public void setToVertex(Vertex vertexTo) {
        toVertex = vertexTo;
    }

    public void setFromVertex(Vertex vertexFrom) {
        fromVertex = vertexFrom;
    }
}
